import React, { memo } from "react";
import { NavLink } from "react-router-dom";
import { LikeParentsStyle } from "./style";
import { getSizeImage } from "@/utils/format-utils";

export default memo(function LikeParents(props) {
  return (
    <LikeParentsStyle>
      <div className="like-box">
        <p>喜欢这个歌单的人</p>
        <div>
          {props.playlistData.playlist.subscribers.map((item, index) => {
            return (
              <NavLink
                to={{
                  pathname: "/user/home",
                  search: "?id=" + item.userId,
                }}
                key={item.userId}
                title={item.nickname}
              >
                <img src={getSizeImage(item.avatarUrl, 40)} alt="" />
              </NavLink>
            );
          })}
        </div>
      </div>
    </LikeParentsStyle>
  );
});
